/**
 * Copyright (C) 2011 PROCESSBASE Ltd.
 * This library is free software; you can redistribute it and/or modify it under the terms
 * of the GPL as published by the Free Software Foundation version 3 of the License.
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 * You should have received a copy of the GNU Lesser General Public License along with this
 * program; if not, see <http://www.gnu.org/licenses/>.
 */
package org.processbase.touchprocess.ui.template;

import com.vaadin.ui.CssLayout;
import com.vaadin.ui.Label;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author marat
 */
public class ChartButton extends CssLayout {

    private static final long serialVersionUID = 1L;
    private String title;
    private static final String STYLENAME = "message-button";

    public ChartButton(String title) {
        try {
            this.title = title;

            setWidth("100%");
            setHeight("100%");
            setStyleName(STYLENAME);

            Label labelTitle = new Label();
            labelTitle.setHeight("1.5em");
            labelTitle.setWidth("-1px");
            labelTitle.setStyleName(STYLENAME + "-process");
            labelTitle.setValue(title);
            addComponent(labelTitle);
        } catch (Exception ex) {
            Logger.getLogger(ChartButton.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public String getTitle() {
        return title;
    }
}
